import { Component } from '@angular/core';
import { NavigationEnd, Router, RouterOutlet } from '@angular/router';
import { StockMangeComponent } from '../../app/components/stock/stock-mange/stock-mange.component';

import { filter } from 'rxjs/operators';
@Component({
  selector: 'app-content',
  imports: [RouterOutlet],
  templateUrl: './content.component.html',
  styleUrl: './content.component.scss'
})
export class ContentComponent {

  pageTitle:string = '';
  pageDesc:string = '';
  constructor(router:Router) {
    router.events.pipe(
      filter(event => event instanceof NavigationEnd)
    ).subscribe((event => {
      switch (event.url) {
        case '/dashboard':
          this.pageTitle = '这里是首页';
          this.pageDesc = ' ';
          break;
        case '/stock':
          this.pageTitle = '股票信息管理';
          this.pageDesc = '进行股票信息基本操作';
          break;
        case '/stock-mange/add':
          this.pageTitle = 'Add Stock';
      }

    }))
  }

}
